package service.imp;

import java.util.List;

import dao.DAOFactory;
import imageUtil.Page;
import model.Bill;
import service.BillService;

public class BillServiceImp implements BillService {

	@Override
	public int findByCount(String vendorName) throws Exception {
		return DAOFactory.getBillDAO().findByCount(vendorName);
	}

	@Override
	public List<Bill> findByAll(Page page, String name) throws Exception {
		return DAOFactory.getBillDAO().findByAll(page,name);
	}

	@Override
	public boolean updateBill(Bill bill) throws Exception {
		return DAOFactory.getBillDAO().updateBill(bill);
	}

	@Override
	public List<Bill> findAll(Page page, String name, String whetherToPay) throws Exception {
		return DAOFactory.getBillDAO().findByAll(page,name,whetherToPay);
	}

	@Override
	public boolean saveBill(Bill bill) throws Exception {
		return DAOFactory.getBillDAO().saveBill(bill);
	}

	@Override
	public int findCount(String vendorName, String whetherToPay) throws Exception {
		return DAOFactory.getBillDAO().findCount(vendorName,whetherToPay);
	}

}
